﻿/*

The MIT License

Copyright (c) 2010 Cartesian Analytics, Inc. 

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

*/

namespace Pipra.Math.Geometry
{
    /// <summary>
    /// A vector within 2D space.
    /// </summary>
    /// <typeparam name="TValue">The element type.</typeparam>
    public interface IVector3<TValue> :
        ICoordinateTriple<TValue>,
        IHasMagnitude<TValue>,
        IGeometry3D<TValue>
    {
        /// <summary>
		/// Calculates the dot product between this vector and another vector.
		/// </summary>
		/// <param name="rhs">Another vector to use for the calculation of the dot product.</param>
		/// <returns>The dot product.</returns>
        TValue Dot(ICoordinateTriple<TValue> rhs);
        /// <summary>
        /// Calculates the cross product of this vector and another.
        /// </summary>
        /// <param name="rhs">Another vector.</param>
        /// <returns>A vector representing the cross product.</returns>
        IVector3<TValue> Cross(ICoordinateTriple<TValue> rhs);
        /// <summary>
        /// Calculates a vector resulting from adding the given vector to this vector.
        /// </summary>
        /// <param name="rhs">The vector to add.</param>
        /// <returns>A result of adding this vector with the given vector.</returns>
        IVector3<TValue> Add(ICoordinateTriple<TValue> rhs);
        /// <summary>
        /// Calculates the difference between this vector and another vector.
        /// </summary>
        /// <param name="rhs">The vector to subtract.</param>
        /// <returns>A result of subtracting the given vector from this vector.</returns>
        IVector3<TValue> Difference(ICoordinateTriple<TValue> rhs);
        /// <summary>
        /// Calculates a vector oriented in the opposite direction.
        /// </summary>
        /// <returns>A vector with the same component values but different signs.</returns>
        IVector3<TValue> GetNegative();
        /// <summary>
        /// Calculates a vector with the same direction but a magnitude of one.
        /// </summary>
        /// <returns>A unit length vector.</returns>
        IVector3<TValue> GetNormalized();
        /// <summary>
        /// Creates a new vector which is scaled from this vector.
        /// </summary>
        /// <param name="factor">The scaling factor.</param>
        /// <returns>A scaled vector.</returns>
        IVector3<TValue> GetScaled(TValue factor);
    }
}
